<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="#{webContext.skin0Culomns}"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="center">
        #{secureGroupEdit.init(param["p1"])}
        <h:form id="editGroupForm">
            <p:breadCrumb>  
                <p:menuitem value="#{ml.tr('Home')}" url="#{webContext.baseUrl}" />  
                <p:menuitem value="#{ml.tr('Group list')}" url="#{lm.ml('secure/group/list.xhtml')}" />  
                <p:menuitem value="#{ml.tr('Edit group')}" url="#" />  
            </p:breadCrumb>
            <p:growl globalOnly="true" id="msg" showDetail="false"/>
            <ui:include src="#{webContext.skinPatch}statusDialog.xhtml" />
            <p:toolbar>
                <p:toolbarGroup align="left">
                    <p:commandButton type="submit"
                                     value="#{ml.tr('Save')}"
                                     image="ui-icon-disk"
                                     actionListener="#{secureGroupEdit.edit()}"
                                     onclick="statusDialog.show()"
                                     oncomplete="statusDialog.hide()"
                                     update="msg"/>
                    <p:divider />
                    <h:outputText value="#{ml.tr('Name of group')}: " />
                    <p:inputText value="#{secureGroupEdit.group.name}" />
                </p:toolbarGroup>
            </p:toolbar>

            <p:dataTable var="role" value="#{secureGroupEdit.allRoles}"
                         paginator="true" rows="#{constants.DATATABLE_ROWS}"
                         selection="#{secureGroupEdit.selectedRoles}">

                <f:facet name="header">
                    #{ml.tr('User roles')}
                </f:facet>

                <p:column selectionMode="multiple" />

                <p:column headerText="#{ml.tr('Name')}">
                    <h:outputText value="#{ml.tr(role.title)}" />
                </p:column>

                <p:column headerText="#{ml.tr('Description')}">
                    <h:outputText value="#{ml.tr(role.description)}" />
                </p:column>
            </p:dataTable>

        </h:form>

    </ui:define>

</ui:composition>
